<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <style>
        .one {
            width: 200px;
            height: 200px;
            background-color: black;
        }

        .two {
            width: 200px;
            height: 200px;
            background-color: green;
            display: none;
        }

        .three {
            width: 200px;
            height: 200px;
            background-color: red;
            display: none;
        }
    </style>
</head>

<body>
    <div class="box1">
        <div class="one">1</div>
        <div class="two">2</div>
        <div class="three">3</div>
        <button class="hit1">点点点</button>
        <button class="hit2">汪汪汪</button>
        <button class="hit3">嘎嘎嘎</button>
    </div>
    <button class="next">下一页</button>
    <div class="box2">
        <div class="one">1</div>
        <div class="two">2</div>
        <div class="three">3</div>
        <button class="hit1">点点点</button>
        <button class="hit2">汪汪汪</button>
        <button class="hit3">嘎嘎嘎</button>
    </div>

    <script>
        let next = document.querySelector(".next")
        let nbs = 0
        //选项卡切换
        function Change(hit, box) {
            hit.forEach((item, key) => {
                item.onclick = function () {
                    box.forEach((num, k) => {
                        if (key == k) {
                            box[k].style.display = "block"
                        } else {
                            box[k].style.display = "none"
                        }
                    })
                }
            })
        }
        let change1 = new Change(hit, box);
        let change2 = new Change(hit1, box1);
        change1.nbs++;
        next.onclick = function () {

        }
        let hit = document.querySelectorAll(".box1 button")
        let box = document.querySelectorAll(".box1 div")
        Change(hit, box)
        let hit1 = document.querySelectorAll(".box2 button")
        let box1 = document.querySelectorAll(".box2 div")
        Change(hit1, box1)

    </script>
</body>

</html>